package com.williams.myo2o.util;

import org.junit.jupiter.api.Test;

/**
 * @auther williams
 * @create-time 2018-07-28-下午2:19
 */


public class PathUtil {

    private static String separator = System.getProperty("file.separator");

    /**用于获取存储图片的主路径*/
    public static String getImageBasePath() {
        String os = System.getProperty("os.name");
        String basePath;
        if (os.toLowerCase().startsWith("win")) {
            basePath = "D/Picture/";
        } else {
            basePath = "/home/williams/Pictures/";
        }
        basePath = basePath.replace("/",separator);
        return basePath;
    }

    /**用于获取存储图片的子路径*/
    public static String getShopImagePath(long shopId){
        String imagePath = "upload/shop" + shopId + "/";
        return imagePath.replace("/",separator);
    }
}


